package com.ayh.campusfun.common;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author ayh
 * @create 2021/3/24 0024 17:57
 * 共用返回类
 */

@Data
@AllArgsConstructor
public class CommonResult {
    private Integer code;
    private String message;
    private Object data;

    public CommonResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static CommonResult success(Object data){
        return new CommonResult(200, "请求成功！",data);
    }

    public static CommonResult successNoData(){
        return new CommonResult(200, "请求成功！");
    }
}
